import cn.hutool.core.util.StrUtil
import cn.hutool.poi.excel.ExcelUtil
import org.junit.jupiter.api.Test
import site.addzero.str.removeIf
import java.io.File

private const val _USERS_ZJARLIN_DOCUMENTS_1_XLS = "/Users/zjarlin/Documents/地下车库水泥土桩桩号(1).xls"

class Excel测试 {




    @Test
    fun exportMissingHValuesToDesktop() {
        val excelReader = ExcelReader()
        val filePath = _USERS_ZJARLIN_DOCUMENTS_1_XLS
        val desktopPath = "${System.getProperty("user.home")
        }/Desktop/missing_h_values1.txt"

        // 生成预期的h值集合 (h1到h17727)
        val expected = (1..17727).map { "h$it" }.toSet()

        // 从Excel中读取实际的h值集合
        val sheetNames = (1..58).map { it.toString() }
        val actual = excelReader.readHValuesFromSheets(filePath, sheetNames)

        // 计算差集：预期的减去实际的
        val missing = expected - actual

        // 导出到桌面
        excelReader.exportMissingHValuesToText(missing, desktopPath)

        println("已将 ${missing.size} 个缺失的h值导出到: $desktopPath")
        println()
    }
    @Test
    fun djaoisdj(): Unit {
               val excelReader = ExcelReader()

        val actual = excelReader .readHValuesFromSheets(_USERS_ZJARLIN_DOCUMENTS_1_XLS, listOf(("44")))
        val contains = actual.contains("h16115")
        println()


    }
}
